<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

        <!-- Vendor styles -->
        <link rel="stylesheet" href="vendors/bower_components/material-design-iconic-font/dist/css/material-design-iconic-font.min.css">
        <link rel="stylesheet" href="vendors/bower_components/animate.css/animate.min.css">
        <link rel="stylesheet" href="vendors/bower_components/jquery.scrollbar/jquery.scrollbar.css">
        <link rel="stylesheet" href="vendors/bower_components/lightgallery/dist/css/lightgallery.min.css">
        <link rel="stylesheet" href="vendors/bower_components/select2/dist/css/select2.min.css">
        
        <link rel="stylesheet" href="vendors/bower_components/dropzone/dist/dropzone.css">
        <link rel="stylesheet" href="vendors/bower_components/flatpickr/dist/flatpickr.min.css" />
        <link rel="stylesheet" href="vendors/bower_components/nouislider/distribute/nouislider.min.css">
        <link rel="stylesheet" href="vendors/bower_components/bootstrap-colorpicker/dist/css/bootstrap-colorpicker.css">
        <link rel="stylesheet" href="vendors/bower_components/trumbowyg/dist/ui/trumbowyg.min.css">
        <link rel="stylesheet" href="vendors/bower_components/rateYo/min/jquery.rateyo.min.css">
         <link rel="stylesheet" href="css/ele.css">

        <!-- App styles -->
        <link rel="stylesheet" href="css/app.min.css">
    </head>


<!---->
    	 <body data-sa-theme="1">
        <main class="main" id='app'>
            <div class="page-loader">
                <div class="page-loader__spinner">
                    <svg viewBox="25 25 50 50">
                        <circle cx="50" cy="50" r="20" fill="none" stroke-width="2" stroke-miterlimit="10" />
                    </svg>
                </div>
            </div>
            <h1 id="top-title">智慧农业物联网管理系统2.0</h1>
            <header class="header">
                <div class="navigation-trigger hidden-xl-up" data-sa-action="aside-open" data-sa-target=".sidebar">
                    <i class="zmdi zmdi-menu"></i>
                </div>
                 
                <div class="logo hidden-sm-down">
                    <h1><a href="index.html" style=""> 智慧农业物联网管理系统2.0</a></h1>
                </div>

                <ul class="top-nav">
                    <!--1-->

                    <li class="hidden-xs-down">
                        <a href="index.html" class="top-nav__themes" data-sa-action="aside-open" data-sa-target=".themes"><i class="zmdi zmdi-palette"></i></a>
                    </li>
                </ul>

                <div class="clock hidden-md-down">
                    <div class="time">
                        <span class="time__hours"></span>
                        <span class="time__min"></span>
                        <span class="time__sec"></span>
                    </div>
                </div>
            </header>
             

            <aside class="sidebar">
                <div class="scrollbar-inner">
                    <div class="user">
                        <div class="user__info" data-toggle="dropdown">
                            <img class="user__img" src="demo/img/profile-pics/8.jpg" alt="">
                            <div>
                                <div class="user__name">{{userName}}</div>
                                <div class="user__email">{{userPhone}}</div>
                            </div>
                        </div>
                        <div class="dropdown-menu">
                            <a class="dropdown-item" href="userXiugai.html">个人资料</a>
                            <a class="dropdown-item" href="../login/index.html">退出</a>
                        </div>
                    </div>
                    <!--菜单开始-->
                     <ul class="navigation" v-for="(value, key, index) in ment" >
                        <li class="@@indexactive"  v-if="!value.childMenu">
                        	<a :href="value.url">
                        		<i :class="value.icon"></i>{{value.name}}
                        	</a>
                        </li>
                        
                        <li class="navigation__sub @@typeactive" v-else>
                            <a :href="value.url">
                            	<i :class="value.icon"></i>{{value.name}}
                            </a>
                            <ul >
                                <li v-for="(value, key, index) in value.childMenu" class="@@navigation__active"><a :href="value.url">{{value.name}}</a></li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </aside>

            <div class="themes">
    <div class="scrollbar-inner">
        <a href="index.html" class="themes__item active" data-sa-value="1"><img src="img/bg/1.jpg" alt=""></a>
        <a href="index.html" class="themes__item" data-sa-value="2"><img src="img/bg/2.jpg" alt=""></a>
        <a href="index.html" class="themes__item" data-sa-value="3"><img src="img/bg/3.jpg" alt=""></a>
        <a href="index.html" class="themes__item" data-sa-value="4"><img src="img/bg/4.jpg" alt=""></a>
        <a href="index.html" class="themes__item" data-sa-value="5"><img src="img/bg/5.jpg" alt=""></a>
        <a href="index.html" class="themes__item" data-sa-value="6"><img src="img/bg/6.jpg" alt=""></a>
        <a href="index.html" class="themes__item" data-sa-value="7"><img src="img/bg/7.jpg" alt=""></a>
        <a href="index.html" class="themes__item" data-sa-value="8"><img src="img/bg/8.jpg" alt=""></a>
        <a href="index.html" class="themes__item" data-sa-value="9"><img src="img/bg/9.jpg" alt=""></a>
        <a href="index.html" class="themes__item" data-sa-value="10"><img src="img/bg/10.jpg" alt=""></a>
    </div>
</div>

<!--33333333333-->

            <section class="content">
                <div class="content__inner">
                    <header class="content__title">
                        <h1>个人信息修改</h1>

                    </header>
                     
                        <div class="card new-contact content__inner content__inner--sm">

                        <div class="card-body"  v-for="(value, key, index) in userData">
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label>用户名</label>
                                        <input type="text" class="form-control" v-model="value.userName" :value="value.userName" placeholder="i.e. John">
                                        <i class="form-group__bar"></i>
                                    </div>
                                </div>

                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label>登录名</label>
                                        <input type="text" class="form-control" v-model="value.loginName" :value="value.loginName" placeholder="i.e. Smith">
                                        <i class="form-group__bar"></i>
                                    </div>
                                </div>

                                <div class="col-md-6">
                                    <div class="form-group" :value="value.sex">
                                        <label>性别</label><br>	
                                        
                                        <template>
											  <el-radio v-model="radio" label="1">男</el-radio>
											  <el-radio v-model="radio" label="0">女</el-radio>
											</template>

                                        
                                        <!--<label class="custom-control custom-radio">
			                                <input id="radio1" name="radio" value="1" type="radio" class="custom-control-input">
			                                <span class="custom-control-indicator"></span>
			                                <span class="custom-control-description">男</span>
			                            </label>

			                            <!--<div class="clearfix mb-2"></div>-->
			
			                            <!--<label class="custom-control custom-radio">
			                                <input type="radio" name="radio" value="0" class="custom-control-input">
			                                <span class="custom-control-indicator"></span>
			                                <span class="custom-control-description">女</span>
			                            </label>-->
			
			                            <div class="clearfix mb-2"></div>
                                        <i class="form-group__bar"></i>
                                    </div>
                                </div>

                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label>年龄</label>
                                        <input type="text" class="form-control" v-model="value.age" :value="value.age" placeholder="i.e. Web Developer">
                                        <i class="form-group__bar"></i>
                                    </div>
                                </div>

                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label>邮箱</label>
                                        <input type="text" class="form-control"  v-model="value.email"  :value="value.email" placeholder="i.e. smith@gmail.com">
                                        <i class="form-group__bar"></i>
                                    </div>
                                </div>

                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label>手机</label>
                                        <input type="text" class="form-control" id="cellphone" v-model="value.cellphone"  :value="value.cellphone" placeholder="10086">
                                        <i class="form-group__bar"></i>
                                    </div>
                                </div>

                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label>电话</label>
                                        <input type="text" class="form-control" v-model="value.telephone" :value="value.telephone" placeholder="">
                                        <i class="form-group__bar"></i>
                                    </div>
                                </div>

                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label>公司</label>
                                        <input type="text" class="form-control" :value="value.companyName" disabled placeholder="">
                                        <i class="form-group__bar"></i>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label>部门</label>
                                        <input type="text" class="form-control" :value="value.groupName" disabled placeholder="">
                                        <i class="form-group__bar"></i>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label>角色</label>
                                        <input type="text" class="form-control" :value="value.roleName" disabled placeholder="">
                                        <i class="form-group__bar"></i>
                                    </div>
                                </div>
                            </div>


                          
                            <div class="clearfix"></div>

                            <div class="mt-5 text-center">
                                <a href="javascript:;" class="btn btn-light" @click="xguserData()">更新</a>
                            </div>
                        </div>
                    </div>
                    


                  
                </div>

                <footer class="footer hidden-xs-down">
                    <p>© 郑州欧柯奇仪器制造有限公司.</p>
                </footer>
            </section>
        </main>

       

        <!-- Javascript -->
        <!-- Vendors -->
        <script src="vendors/bower_components/jquery/dist/jquery.min.js"></script>
        <script src="vendors/bower_components/popper.js/dist/umd/popper.min.js"></script>
        <script src="vendors/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
        <script src="vendors/bower_components/jquery.scrollbar/jquery.scrollbar.min.js"></script>
        <script src="vendors/bower_components/jquery-scrollLock/jquery-scrollLock.min.js"></script>


        <script src="vendors/bower_components/jquery-mask-plugin/dist/jquery.mask.min.js"></script>
        <script src="vendors/bower_components/select2/dist/js/select2.full.min.js"></script>
        <script src="vendors/bower_components/dropzone/dist/min/dropzone.min.js"></script>
        <script src="vendors/bower_components/moment/min/moment.min.js"></script>
        <script src="vendors/bower_components/flatpickr/dist/flatpickr.min.js"></script>
        <script src="vendors/bower_components/nouislider/distribute/nouislider.min.js"></script>
        <script src="vendors/bower_components/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js"></script>
        <script src="vendors/bower_components/trumbowyg/dist/trumbowyg.min.js"></script>
        <script src="vendors/bower_components/rateYo/min/jquery.rateyo.min.js"></script>
        <script src="vendors/bower_components/jquery-text-counter/textcounter.min.js"></script>
        <script src="vendors/bower_components/autosize/dist/autosize.min.js"></script>


        <!-- Light Gallery -->
        <!--<script src="vendors/bower_components/lightgallery/dist/js/lightgallery-all.min.js"></script>-->

        <!-- App functions and actions -->
        <script src="js/app.min.js"></script>
        <script src="https://cdn.staticfile.org/vue/2.4.2/vue.min.js"></script>
        <script src="https://cdn.staticfile.org/axios/0.18.0/axios.min.js"></script>
            <script src="../js/cookie.js" type="text/javascript" charset="utf-8"></script>
        <script src="../js/best.js" type="text/javascript" charset="utf-8"></script>
        <script src="js/ele.js"></script>
        
        <script>
    new Vue({
	el: '#app',
	data:function() {
		return {
			radio: '1',
			userPhone:null,
			userName:null,
			userData:null,
			ment:null,
			baozi:null,
			parms:null,
			loading: false,
			currentPage: 1,
	        pageSize: 30,
	        currentTotal: 0,
	        pickerOptions: {
          shortcuts: [{
            text: '最近一周',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit('pick', [start, end]);
            }
          }, {
            text: '最近一个月',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit('pick', [start, end]);
            }
          }, {
            text: '最近三个月',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit('pick', [start, end]);
            }
          }]
		      
		},
		quyu:null,
		gongshiou1:[],
		      gongshiou2:[],
		      gongshiou:[],
		      value:'',
		      queryParams: {
	        pageNum: 1,
	        pageSize: 10,
	        deptName:undefined,
	        roleName: undefined,
	        roleKey: undefined,
	        status: undefined
	        },
		      // 日期范围
		      dateRange: [],
		      
		      // 非单个禁用
		      single: true
		}
	},
	mounted() {
			//获取菜单
		axios(basePath + '/menu/findMenuList.do', {
			method: 'GET',
			mode: 'no-cors',
			headers: {
				'Access-Control-Allow-Origin': '*',
				'Content-Type': 'application/json',
			},
			withCredentials: true,
			credentials: 'same-origin',
		}).then(response => {
			if(response.data.state) {
				this.ment = response.data.data
				this.userPhone=getCookie('userPhone');
						this.userName=getCookie('userName');
			} else {
				alert(response.data.msg)
				window.location.href = "../login/"
			}

		}).catch(function(error) { // 请求失败处理
			console.log(error);
		});
		
		
		//this.getbaozi()
		
		//获取设备
			var data2 = {
		        eqType:"5",
		        eqModel:'0'
	          };
	          var this_=this;
	      ajaxType(basePath + '/area/selectAreaByEquipmnt.do','post',data2,geturl)
	       function geturl(data){
	       	console.log(data)
//	       	this_.gongshiou2 = '';
	        	this_.gongshiou = data.data;
	      
	       }
		
		this.getuserData();
			
	},
	methods: {
		
			//获取用户信息
		getuserData(val) {
	      	var this_=this;
	      	ajaxType(basePath + '/user/selectUserInfo.do','get','',geturl)
	       	function geturl(data){
	       	console.log(data)
	        	this_.userData = data.data;
	        	if(this_.userData[0].sex==0){
	        		this_.radio='0';
	        	}else{
	        		this_.radio='1';
	        	}
	      
	       }		
					
		},
		
		xguserData(val) {
			
			var this_=this;
			var data2 = this_.userData[0];
			data2.sex = parseInt(this_.radio);
          
          if((/^1(3|4|5|6|7|8|9)\d{9}$/.test(data2.cellphone))){
          	ajaxTypec(basePath + '/user/editUser.do','post',data2,geturl)
	       	function geturl(data){
	       	console.log(data)
	        	if(data.state){
	        		this_.$message({
			          message: data.msg,
			          type: 'success'
			        });;
	        	}else{
	        		this_.$message.error(data.msg);
	        	}
	      
	       }
          }else{
          	this_.$message.error("请输入正确的手机号码");
          }
	      			
					
		},
		
		
		
		
		
		
		
		
		
		
		
			//获取设备
		Rolechanges(val) {
			//获取设备
			var data1 = {
		        areaId: val,
	          };
	          var this_=this;
	      ajaxType(basePath + '/equipment/findEquipmentByAreaIdAndType.do','get',data1,geturl)
	       function geturl(data){
	       	console.log(data)
	       	this_.gongshiou2 = '';
	        	this_.gongshiou1 = data.data;
	      
	       }		
					
		},
		 open(data_A) {
        this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
        	
        	
        	
          this.$message({
            type: 'success',
            message: '删除成功!'
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          });          
        });
      },
		
		
		
		
		 handleSizeChange(val) {
        this.pageSize = val;
        console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(val) {
        this.currentPage = val;
        console.log(`当前页: ${val}`);
        var vall ={pageIndex:this.currentPage,
				areaId:this.quyu,
                eqId:this.gongshiou2,
               startTime:this.dateRange[0],
               endTime:this.dateRange[1]}
        this.getbaozi(vall)
			
	},
	currentPage(val){
		 console.log(val);
	},
	getbaozi(val){
		 this.loading = true;
		axios(basePath + '/picture/selectSporePicList.do?pageSize=12', {
			method: 'GET',
			mode: 'no-cors',
			headers: {
				'Access-Control-Allow-Origin': '*',
				'Content-Type': 'application/json',
			},
			withCredentials: true,
			credentials: 'same-origin',
			params:val
		}).then(response => {
			if(response.data.state) {
				this.baozi = response.data.data
				this.parms = response.data.parms.totalCount
				this.loading = false;
				console.log(response);
				if(response.data.data==''){
					this.$message.error('没有获取到信息哦');
				}
			} else {
				alert(res.data.msg)
				window.location.href = "../login/login.html"
				
			}

		}).catch(function(error) { // 请求失败处理
			console.log(error);
		});
	},
	 /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      console.log(this.dateRange);
      console.log(this.quyu)
      console.log(this.gongshiou2)
      
      var datal={
				pageIndex:this.currentPage,
				areaId:this.quyu,
                eqId:this.gongshiou2,
               startTime:this.dateRange[0],
               endTime:this.dateRange[1]
      }
      this.getbaozi(datal)
//    this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.dateRange = [];
      this.resetForm("queryForm");
      this.handleQuery();
    },
      /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.opentianjian = true;
      this.title = "添加";
    },
    
    fenxi(){
    	console.log()
    },
    shanchu(){
    	console.log()
    }
     }
})</script>
        
    </body>
</html>